package cn.edu.qlnu.xky.test.service;

import cn.edu.qlnu.xky.test.common.Page;
import cn.edu.qlnu.xky.test.dao.BorrowDao;
import cn.edu.qlnu.xky.test.model.Borrow;

/**
 * @author : wuweihong
 * @desc : TODO  请填写你的功能描述
 * @date : 2025-06-21
 */


public class BorrowService {

	BorrowDao borrowDao = null;

	public BorrowService() {
		borrowDao = new BorrowDao();
	}

	public int borrowBook(Borrow borrow) {
		return borrowDao.borrowBook(borrow, 5);
	}

	public int updateBorrow(Borrow borrow) {
		return borrowDao.updateBorrow(borrow);
	}

	public Borrow searchById(int id) {
		return borrowDao.searchById(id);
	}

	public Page<Borrow> searchByStatusAndUserId(String userName, Integer adminStatus, Integer isReturn, Integer userId, int pageNo) {
		return borrowDao.searchByStatusAndUserId(userName, adminStatus, isReturn, userId, pageNo);
	}

}
